package com.woniu.user.aopanno;

import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Component
@Aspect    //生成代理对象
public class UserProxy {

//    //前置通知
//    //@before注解表示作为前置通知
//    @Before(value = "execution(* com.woniu.user.service.impl.UserServiceImpl.cancelDog(..))")
//    public void before(){
//        System.out.println("cancelDog  before..........");
//    }

    //异常通知
    @AfterThrowing(value = "execution(* com.woniu.user.service.impl.UserServiceImpl.cancelDog(..))")
    public void afterThrowing(){
        System.out.println("AfterThrowing..........");
    }
}
